package com.m4u.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.TableGenerator;

@Entity
@TableGenerator(name = "CLIENTE_ID", pkColumnValue = "CLIENTE_ID", allocationSize = 1)
@NamedQueries( { @NamedQuery(name = Usuario.FIND_BY_USER_NAME, query = "from Usuario where login = :login") })
public class Usuario {

    public static final String FIND_BY_USER_NAME = "com.m4u.jpa.entity.Usuario.findByUserName";

    @Id
    @GeneratedValue(strategy = GenerationType.TABLE, generator = "CLIENTE_ID")
    private Integer id;

    @Column
    private String login;

    @Column
    private String password;

    @Column
    private String nome;

    @Enumerated(EnumType.ORDINAL)
    private Sexo sexo;

    public Sexo getSexo() {
        return sexo;
    }

    public void setSexo(Sexo sexo) {
        this.sexo = sexo;
    }

    /*
     * Gets e Sets
     */
    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getLogin() {
        return login;
    }

    public void setLogin(String login) {
        this.login = login;
    }

    public String getNome() {
        return nome;
    }

    public void setNome(String nome) {
        this.nome = nome;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

}